<?php 
	
	include("protected/dbconnect.php");
	//check data get form client
	if($_GET["cbb_id_hv"]!=0){	

		//get day local
		$local_date = date("y-m-d:h:m:s");
		
		//get thong tin tu Block poll
		$stuid = $_GET["cbb_id_hv"];
		$poll_type_id = $_GET["opt"];
		$sql_query="INSERT INTO `poll` (`poll_type_id` ,`poll_result` ,`poll_date` ,`poll_ip` ,`stuid`) VALUES (?,?,?,?,?)";
		$cmd = $mysqli-> prepare($sql_query);
		$cmd -> bind_param("sssss",$poll_type_id,$poll_type_id,$local_date,$_SERVER['REMOTE_ADDR'],$stuid);		
		if($cmd -> execute()){			
			include_once("com_poll_result.php");
			//$core_class-> _redirect("test.php");					
		}
		else{			
			die($mysql->error);
		}		
	}
	else{
		$core_class->_redirect(".");
	}
	$cmd ->close();
?>
